package com.scut.edu.wanyou.channel;

import java.security.PublicKey;

import com.scut.edu.wanyou.R;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class WanwanActivity extends Activity implements OnClickListener{
	private ImageView headImgView;
	private TextView nickNameTextView;
	private TextView publishTimeTextView;
	private TextView start_endTextView;
	private TextView locationTextView;
	private ImageView details_pic;
	private TextView detailsTextView;
	private ListView commentsListView;
	
	Boolean isJoin=false;
	 ImageView mBut1, mBut2, mBut3;
	 TextView mText1, mText2, mText3;
	
	
	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.wanwan_details);
		
		findViewById(R.id.wanwan_chat).setOnClickListener(this);
        findViewById(R.id.wanwan_share).setOnClickListener(this);
        findViewById(R.id.wanwan_join).setOnClickListener(this);
        mBut1 = (ImageView) findViewById(R.id.imageView1);
        mBut2 = (ImageView) findViewById(R.id.imageView2);
        mBut3 = (ImageView) findViewById(R.id.imageView3);
        mText1 = (TextView) findViewById(R.id.textView1);
        mText2 = (TextView) findViewById(R.id.textView2);
        mText3 = (TextView) findViewById(R.id.textView3);

	}





	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.wanwan_chat:
			break;
		case R.id.wanwan_share:
			mBut2.setImageResource(R.drawable.wanwan_share2);
			mText2.setTextColor(Color.parseColor("#00a9ec"));
			break;
		case R.id.wanwan_join:
			if(isJoin==false){
				mBut3.setImageResource(R.drawable.wanwan_join2);
				mText3.setTextColor(Color.parseColor("#00a9ec"));
				isJoin=true;
			}
			else{
				Toast.makeText(this, "你已经参加该活动了", Toast.LENGTH_LONG).show();
			}
			
			break;

		default:
			break;
		}
		
	}




	
}
